<template>
  <div>
    <button @click="add">+1</button>
    <button @click="addFn(100)">+100</button>

    <button @click="xxx">异步调用</button>
    <button @click="getAsyncCount(222)">辅助函数的异步调用</button>
    <p>{{ $store.getters.filterList }}</p>
    <p>{{ filterList }}</p>
  </div>
</template>

<script>
import { mapActions, mapMutations, mapGetters } from "vuex";
export default {
  methods: {
    add() {
      this.$store.commit("addCount");
    },
    ...mapMutations(["addFn"]),
    xxx() {
      this.$store.dispatch("getAsyncCount", 111);
    },
    ...mapActions(["getAsyncCount"]),
  },
  computed: {
    ...mapGetters(["filterList"]),
  },
};
</script>

<style></style>
